package com.net.xpay.core.manager.safePay;

import com.net.xpay.core.dto.AccountAmountCountDto;
import com.net.xpay.core.model.*;
import com.net.common.manager.VersionedManager;
import com.net.xpay.core.domain.safePay.SafePayBatch;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;


public interface SafePayBatchManager extends VersionedManager<Long,SafePayBatch> {
    SafePayBatch findByImportBatchNo(Long userId, String importBatchNo);

    List<Long> listNeedTransBatch();

    SafePayBatch findById(Long userId, Long id);

    List<Long> listIds(SafePayBatchSearchModel searchModel);

    List<SafePayBatch> search(SafePayBatchSearchModel searchModel);

    List<SafePayBatch> list(SafePayBatchSearchModel searchModel);

    long searchCount(SafePayBatchSearchModel searchModel);

    UserSafePayTransStatModel countAmountAndTimesOfSuccess(Long userId, LocalDateTime minEndTime, LocalDateTime maxEndTime);

    CompanyBillDailyStatModel statDailyCompanyBill(LocalDateTime minEndTime, LocalDateTime maxEndTime);

    SafePayBatchStatResultModel statLevelOneSuccessSafePayBatch(Long partnerId, LocalDateTime minEndTime, LocalDateTime maxEndTime);

    SafePayBatchStatResultModel statLevelTwoSuccessSafePayBatch(Long partnerId, LocalDateTime minEndTime, LocalDateTime maxEndTime);

    BigDecimal getTransferLimit(LocalDateTime currentDayStartTime, LocalDateTime currentDayEndTime, Long userId, Long safePayBookAccountId);
    /**
     *统计到卡
     */
    UserSafePayTransStatCommonModel countAmountAndTimesOfSuccessBank(Long userId, LocalDateTime minEndTime, LocalDateTime maxEndTime);

    /**
     *统计到支付宝
     */
    UserSafePayTransStatCommonModel countAmountAndTimesOfSuccessAlipay(Long id, LocalDateTime minEndTime, LocalDateTime maxEndTime);
    /**
     *统计到卡(不免费)
     */
    UserSafePayTransStatCommonModel countAmountAndTimesOfSuccessNotFreeBank(Long id, LocalDateTime minEndTime, LocalDateTime maxEndTime);
    /**
     *统计到支付宝(不免费)
     */
    UserSafePayTransStatCommonModel countAmountAndTimesOfSuccessNotFreeAlipay(Long id, LocalDateTime minEndTime, LocalDateTime maxEndTime);
    /**
     *统计用户当日数据
     */
    PartnerUserSafePayTransDayStatModel sumPartnerUserSafePayTransDay(Long userId, LocalDateTime minEndTime, LocalDateTime maxEndTime);
    /**
     *统计合伙人当日数据
     */
    PartnerUserSafePayTransDayStatModel sumPartnerSafePayTransDay(Long partnerId, LocalDateTime minEndTime, LocalDateTime maxEndTime);
    /**
     * 统计当日的活跃合伙人数
     */
    SafePayTransDailyStatModel statActivePartnerCount(LocalDateTime minEndTime, LocalDateTime maxEndTime);
    /**
     * 统计当日的后台经营数据
     */
    CompanySafePayTransDayStatModel sumCompanySafePayTransDay(LocalDateTime minEndTime, LocalDateTime maxEndTime);
    /**
     * 统计超过500万的账户数
     */
    long sumTotalVeryAlipayUserCount(LocalDateTime minEndTime, LocalDateTime maxEndTime);
    /**
     * 统计用户超过500万的账户数
     */
    long sumUserTotalVeryAlipayUserCount(Long userId, LocalDateTime minEndTime, LocalDateTime maxEndTime);
    /**
     * 统计到卡
     */
    SafePayTransBankDailyStatModel statSafePayTransBankAmount(LocalDateTime minEndTime, LocalDateTime maxEndTime);

    /**
     * 统计到支付宝
     */
    AccountAmountCountDto sumSafeSuccessAmount(LocalDateTime startTime, LocalDateTime endTime, Long id, LocalDateTime dayTime);
}
